package com.kuaiyin.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.kuaiyin.sampling.BaseVo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Map;

/**
 * <p>
 * JMeter测试配置表 - 视图对象
 * </p>
 *
 * @author ng
 * @since 2025-06-24
 */
@Data
@Schema(name = "JmeterTestVO", description = "JMeter测试配置VO")
public class JMeterTestVO extends BaseVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID")
    private Integer id;

    @Schema(description = "压测计划名称")
    private String name;

    @Schema(description = "关联测试计划ID")
    private Long planId;

    @Schema(description = "测试类型（SIMPLE/JMX）")
    private String type;

    @Schema(description = "压测备注")
    private String comment;

    @Schema(description = "线程组名称")
    private String threadGroupName;

    @Schema(description = "并发用户数")
    private Integer threads;

    @Schema(description = "启动时间（秒）")
    private Integer rampUp;

    @Schema(description = "循环次数（-1表示永远）")
    private Integer loops;

    @Schema(description = "是否使用调度器")
    private Boolean scheduler;

    @Schema(description = "持续时间（秒）")
    private Integer duration;

    @Schema(description = "延迟启动（秒）")
    private Integer delayedStart;

    @Schema(description = "JMX文件路径")
    private String filePath;

    @Schema(description = "响应提取配置")
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private Map<String, Map<String, String>> responseExtract;
}
